import { Button, DatePicker, Tooltip } from 'antd';
import { DownloadOutlined, DeleteOutlined, UploadOutlined } from '@ant-design/icons';
import { onMouseOutBtn, removeDateHmsStr, renderTableText, tableSorter } from '@/utils';
import pageStyles from '@/common/pageLayout.less';
import { DictionaryRenderFun, formatDecimal, formatDecimalFour } from '../../Acommon';

/** 资产表格  (变动类型：一般) */
const openAssetColumns = (delSelectRow, openAssetModalStatus, openUploadModalStatus, openDraw, pageType?: string) => {
  let tableConfig: Record<string, any>[] = [
    {
      title: '资产编号',
      dataIndex: 'assetCode',
      key: 'assetCode',
      width: 160,
      fixed: 'left',
      visible: true,
      sorter: (a: any, b: any) => (a.assetCode > b.assetCode ? 1 : -1),
      render: (text: string, record) => {
        return (
          <Tooltip title={text}>
            {/* <div className={pageStyles['over-flow-hidden']}>{text || '--'}</div> */}
            <a className={pageStyles['over-flow-hidden']} onClick={() => openDraw(record)}>
              {text || '--'}
            </a>
          </Tooltip>
        );
      },
    },
    {
      title: '资产名称',
      dataIndex: 'assetNameNew',
      key: 'assetNameNew',
      width: 160,
      fixed: 'left',
      ellipsis: {
        showTitle: true,
      },
      visible: true,
      unDrag: true,
      sorter: (a: any, b: any) => (a.assetNameNew > b.assetNameNew ? 1 : -1),
      render: (text: string) => {
        return (
          <Tooltip title={text}>
            <div className={pageStyles['over-flow-hidden']}>{text || '--'}</div>
          </Tooltip>
        );
      },
    },
    {
      title: '品牌',
      dataIndex: 'brandTypeName',
      key: 'brandTypeName',
      width: 120,
      visible: true,
      sorter: (a: any, b: any) => (a.brandTypeName > b.brandTypeName ? 1 : -1),
      render: (text: number | null) => DictionaryRenderFun({ text, isState: false }),
    },

    {
      title: '规格型号',
      dataIndex: 'paramsInfoNew',
      key: 'paramsInfoNew',
      width: 170,
      visible: true,
      sorter: (a: any, b: any) => (a.paramsInfoNew > b.paramsInfoNew ? 1 : -1),
      render: (text: string) => {
        return (
          <Tooltip title={text}>
            <div className={pageStyles['over-flow-hidden']}>{text || '--'}</div>
          </Tooltip>
        );
      },
    },
    {
      title: '计量单位',
      dataIndex: 'unitOfMeasurementNewName',
      key: 'unitOfMeasurementNewName',
      width: 110,
      visible: true,
      sorter: (a: any, b: any) => (a.unitOfMeasurementNewName > b.unitOfMeasurementNewName ? 1 : -1),
      render: (text: number | null) => DictionaryRenderFun({ text, isState: false }),
    },

    {
      title: '采购组织形式',
      dataIndex: 'procureOrgTypeNewName',
      key: 'procureOrgTypeNewName',
      width: 120,
      ellipsis: {
        showTitle: true,
      },
      visible: true,
      unDrag: true,
      sorter: (a: any, b: any) => (a.procureOrgTypeNewName > b.procureOrgTypeNewName ? 1 : -1),
      render: (text: number | null) => DictionaryRenderFun({ text, isState: false }),
    },

    {
      title: '投入使用日期',
      dataIndex: 'operationalDateNew',
      key: 'operationalDateNew',
      width: 180,
      visible: true,
      sorter: (a: any, b: any) => (a.operationalDateNew > b.operationalDateNew ? 1 : -1),
      render: (text: string) => removeDateHmsStr(text) || '--',
    },
    {
      title: '资产用途',
      dataIndex: 'usedTypeNewName',
      key: 'usedTypeNewName',
      width: 120,
      ellipsis: {
        showTitle: true,
      },
      visible: true,
      unDrag: true,
      sorter: (a: any, b: any) => (a.usedTypeNewName > b.usedTypeNewName ? 1 : -1),
      render: (text: number | null) => DictionaryRenderFun({ text, isState: false }),
    },
    {
      title: '清查编号',
      dataIndex: 'inventoryNumberNew',
      key: 'inventoryNumberNew',
      width: 120,
      ellipsis: {
        showTitle: true,
      },
      visible: true,
      unDrag: true,
      sorter: (a: any, b: any) => (a.inventoryNumberNew > b.inventoryNumberNew ? 1 : -1),
      render: (text: number | null) => DictionaryRenderFun({ text, isState: false }),
    },
    {
      title: '管理部门',
      dataIndex: 'assetNewDepartmentName',
      key: 'assetNewDepartmentName',
      width: 150,
      visible: true,
      sorter: (a: any, b: any) => (a.assetNewDepartmentName > b.assetNewDepartmentName ? 1 : -1),
      render: (text: string) => {
        return (
          <Tooltip title={text}>
            <div className={pageStyles['over-flow-hidden']}>{text || '--'}</div>
          </Tooltip>
        );
      },
    },
    {
      title: '管理人',
      dataIndex: 'assetNewerName',
      key: 'assetNewerName',
      width: 150,
      visible: true,
      sorter: (a: any, b: any) => (a.assetNewerName > b.assetNewerName ? 1 : -1),
      render: (text: string) => {
        return (
          <Tooltip title={text}>
            <div className={pageStyles['over-flow-hidden']}>{text || '--'}</div>
          </Tooltip>
        );
      },
    },
    {
      title: '使用部门',
      dataIndex: 'usNewDepartmentName',
      key: 'usNewDepartmentName',
      width: 150,
      visible: true,
      sorter: (a: any, b: any) => (a.usNewDepartmentName > b.usNewDepartmentName ? 1 : -1),
      render: (text: string) => {
        return (
          <Tooltip title={text}>
            <div className={pageStyles['over-flow-hidden']}>{text || '--'}</div>
          </Tooltip>
        );
      },
    },
    {
      title: '使用人',
      dataIndex: 'usNewerName',
      key: 'usNewerName',
      width: 150,
      visible: true,
      sorter: (a: any, b: any) => (a.usNewerName > b.usNewerName ? 1 : -1),
      render: (text: string) => {
        return (
          <Tooltip title={text}>
            <div className={pageStyles['over-flow-hidden']}>{text || '--'}</div>
          </Tooltip>
        );
      },
    },
    {
      title: '存放区域',
      dataIndex: 'locationNewName',
      key: 'locationNewName',
      width: 110,
      visible: true,
      sorter: (a: any, b: any) => (a.locationNewName > b.locationNewName ? 1 : -1),
      render: (text: number | null) => DictionaryRenderFun({ text, isState: false }),
    },
    {
      title: '详细地点',
      dataIndex: 'locationInfoNew',
      key: 'locationInfoNew',
      width: 180,
      visible: true,
      sorter: (a: any, b: any) => (a.locationInfoNew > b.locationInfoNew ? 1 : -1),
      render: (text: string) => {
        return (
          <Tooltip title={text}>
            <div className={pageStyles['over-flow-hidden']}>{text || '--'}</div>
          </Tooltip>
        );
      },
    },
    // {
    //   title: '资产分类',
    //   dataIndex: 'assetClassName',
    //   key: 'assetClassName',
    //   width: 120,
    //   ellipsis: {
    //     showTitle: true,
    //   },
    //   visible: true,
    //   unDrag: true,
    //   sorter: (a: any, b: any) => (a.assetClassName > b.assetClassName ? 1 : -1),
    //   render: (text: number | null) => DictionaryRenderFun({ text, isState: false }),
    // },

    // {
    //   title: '数量',
    //   dataIndex: 'quantityOrArea',
    //   key: 'quantityOrArea',
    //   width: 100,
    //   visible: true,
    //   sorter: (a: any, b: any) => (a.quantityOrArea > b.quantityOrArea ? 1 : -1),
    //   render: (text: string | number) => {
    //     return (
    //       <Tooltip title={text}>
    //         <div className={pageStyles['over-flow-hidden']}>{text === 0 || text ? text : '--'}</div>
    //       </Tooltip>
    //     );
    //   },
    // },

    // {
    //   title: '资产原值（元）',
    //   dataIndex: 'totalValue',
    //   key: 'totalValue',
    //   width: 160,
    //   visible: true,
    //   sorter: (a: any, b: any) => (a.totalValue > b.totalValue ? 1 : -1),
    //   render: (text: number | null) => formatDecimalFour(text),
    // },

    // {
    //   title: '取得方式',
    //   dataIndex: 'obtainTypeName',
    //   key: 'obtainTypeName',
    //   width: 150,
    //   visible: true,
    //   sorter: (a: any, b: any) => (a.obtainTypeName > b.obtainTypeName ? 1 : -1),
    //   render: (text: number | null) => DictionaryRenderFun({ text, isState: false }),
    // },
    // {
    //   title: '取得日期',
    //   dataIndex: 'obtainDate',
    //   key: 'obtainDate',
    //   width: 200,
    //   visible: true,
    //   sorter: (a: any, b: any) => (a.obtainDate > b.obtainDate ? 1 : -1),
    //   render: (text: string) => removeDateHmsStr(text) || '--',
    // },
    // {
    //   title: '合同编号',
    //   dataIndex: 'contractCode',
    //   key: 'contractCode',
    //   width: 150,
    //   visible: true,
    //   sorter: (a: any, b: any) => (a.contractCode > b.contractCode ? 1 : -1),
    //   render: (text: string) => {
    //     return (
    //       <Tooltip title={text}>
    //         <div className={pageStyles['over-flow-hidden']}>{text || '--'}</div>
    //       </Tooltip>
    //     );
    //   },
    // },
    // {
    //   title: '财务入账状态',
    //   dataIndex: 'entryStateName',
    //   key: 'entryStateName',
    //   width: 150,
    //   visible: true,
    //   sorter: (a: any, b: any) => (a.entryStateName > b.entryStateName ? 1 : -1),
    //   render: (text: number | null) => DictionaryRenderFun({ text, isState: false }),
    // },
  ];
  if (pageType != 'detail') {
    tableConfig?.push({
      title: (
        <div style={{ width: '100%', textAlign: 'center' }}>
          <Button type="link" size="small" className="manageBtntTxtStyle" onMouseOut={onMouseOutBtn} onClick={openAssetModalStatus} icon={<DownloadOutlined />}>
            导出
          </Button>
          <Button type="link" size="small" className="manageBtntTxtStyle" onMouseOut={onMouseOutBtn} onClick={openUploadModalStatus} icon={<UploadOutlined />}>
            导入
          </Button>
        </div>
      ),
      dataIndex: 'otherBtn',
      key: 'otherBtn',
      visible: true,
      width: 150,
      fixed: 'right',
      render: (_text: any, record: any) => {
        return (
          <div className="counterpoartDelBtnStyle">
            <Button
              type="link"
              size="small"
              icon={<DeleteOutlined />}
              className={'manageBtntTxtStyle'}
              onMouseOut={onMouseOutBtn}
              onClick={() => delSelectRow(record)}
            >
              删除
            </Button>
          </div>
        );
      },
    });
  }
  return tableConfig;
};

/** 资产表格  (变动类型：重要) [合并原本的 "重要" 和 "种类"]*/
const openImportColumns = (delSelectRow, openAssetModalStatus, openUploadModalStatus, openDraw, pageType?: string) => {
  let tableConfig: Record<string, any>[] = [
    {
      title: '资产编号',
      dataIndex: 'assetCode',
      key: 'assetCode',
      width: 160,
      fixed: 'left',
      visible: true,
      sorter: (a: any, b: any) => (a.assetCode > b.assetCode ? 1 : -1),
      render: (text: string, record) => {
        return (
          <Tooltip title={text}>
            {/* <div className={pageStyles['over-flow-hidden']}>{text || '--'}</div>
             */}
            <a className={pageStyles['over-flow-hidden']} onClick={() => openDraw(record)}>
              {text || '--'}
            </a>
          </Tooltip>
        );
      },
    },
    {
      title: '资产名称',
      dataIndex: 'assetNameNew',
      key: 'assetNameNew',
      width: 160,
      fixed: 'left',
      ellipsis: {
        showTitle: true,
      },
      visible: true,
      unDrag: true,
      sorter: (a: any, b: any) => (a.assetNameNew > b.assetNameNew ? 1 : -1),
      render: (text: string) => {
        return (
          <Tooltip title={text}>
            <div className={pageStyles['over-flow-hidden']}>{text || '--'}</div>
          </Tooltip>
        );
      },
    },
    {
      title: '资产分类',
      dataIndex: 'assetClassNewName',
      key: 'assetClassNewName',
      width: 120,
      ellipsis: {
        showTitle: true,
      },
      visible: true,
      unDrag: true,
      sorter: (a: any, b: any) => (a.assetClassNewName > b.assetClassNewName ? 1 : -1),
      render: (text: number | null) => DictionaryRenderFun({ text, isState: false }),
    },
    {
      title: '资产原值（元）',
      dataIndex: 'totalValueNew',
      key: 'totalValueNew',
      width: 170,
      visible: true,
      sorter: (a: any, b: any) => (a.totalValueNew > b.totalValueNew ? 1 : -1),
      render: (text: number | null) => formatDecimalFour(text),
    },
    {
      title: '财政拨款',
      dataIndex: 'fiscalAppropriationNew',
      key: 'fiscalAppropriationNew',
      width: 160,
      visible: true,
      sorter: (a: any, b: any) => (a.fiscalAppropriationNew > b.fiscalAppropriationNew ? 1 : -1),
      render: (text: number | null) => formatDecimalFour(text),
    },
    {
      title: '非财政拨款',
      dataIndex: 'noFiscalAppropriationNew',
      key: 'noFiscalAppropriationNew',
      width: 160,
      visible: true,
      sorter: (a: any, b: any) => (a.noFiscalAppropriationNew > b.noFiscalAppropriationNew ? 1 : -1),
      render: (text: number | null) => formatDecimalFour(text),
    },
    {
      title: '财务入账状态',
      dataIndex: 'entryStateNewName',
      key: 'entryStateNewName',
      width: 150,
      visible: true,
      sorter: (a: any, b: any) => (a.entryStateNewName > b.entryStateNewName ? 1 : -1),
      render: (text: number | null) => DictionaryRenderFun({ text, isState: false }),
    },

    {
      title: '记账日期',
      dataIndex: 'entryDateNew',
      key: 'entryDateNew',
      width: 200,
      visible: true,
      sorter: (a: any, b: any) => (a.entryDateNew > b.entryDateNew ? 1 : -1),
      render: (text: string) => removeDateHmsStr(text) || '--',
    },
    {
      title: '记账凭证号',
      dataIndex: 'entryCodeNew',
      key: 'entryCodeNew',
      width: 200,
      visible: true,
      sorter: (a: any, b: any) => (a.entryCodeNew > b.entryCodeNew ? 1 : -1),
      render: (text: number | null) => DictionaryRenderFun({ text, isState: false }),
    },
    {
      title: '折旧年限（月）',
      dataIndex: 'durableYearsNew',
      key: 'durableYearsNew',
      width: 160,
      visible: true,
      sorter: (a: any, b: any) => (a.durableYearsNew > b.durableYearsNew ? 1 : -1),
      render: (text: number | null) => formatDecimalFour(text),
    },
    {
      title: '单位会计科目',
      dataIndex: 'ledgerAccountNewName',
      key: 'ledgerAccountNewName',
      width: 160,
      visible: true,
      sorter: (a: any, b: any) => (a.ledgerAccountNewName > b.ledgerAccountNewName ? 1 : -1),
      render: (text: number | null) => DictionaryRenderFun({ text }),
    },
  ];
  if (pageType != 'detail') {
    if (pageType != 'detail') {
      tableConfig?.push({
        title: (
          <div style={{ width: '100%', textAlign: 'center' }}>
            <Button
              type="link"
              size="small"
              className="manageBtntTxtStyle"
              onMouseOut={onMouseOutBtn}
              onClick={openAssetModalStatus}
              icon={<DownloadOutlined />}
            >
              导出
            </Button>
            <Button
              type="link"
              size="small"
              className="manageBtntTxtStyle"
              onMouseOut={onMouseOutBtn}
              onClick={openUploadModalStatus}
              icon={<UploadOutlined />}
            >
              导入
            </Button>
          </div>
        ),
        dataIndex: 'otherBtn',
        key: 'otherBtn',
        visible: true,
        width: 150,
        fixed: 'right',
        render: (_text: any, record: any) => {
          return (
            <div className="counterpoartDelBtnStyle">
              <Button
                type="link"
                size="small"
                icon={<DeleteOutlined />}
                className={'manageBtntTxtStyle'}
                onMouseOut={onMouseOutBtn}
                onClick={() => delSelectRow(record)}
              >
                删除
              </Button>
            </div>
          );
        },
      });
    }
  }
  return tableConfig;
};

/** 资产表格  (变动类型：重要) [作废]*/
const openImportantAssetColumns = (delSelectRow, openAssetModalStatus, openUploadModalStatus, openDraw, pageType?: string) => {
  let tableConfig: Record<string, any>[] = [
    {
      title: '资产编号',
      dataIndex: 'assetCode',
      key: 'assetCode',
      width: 160,
      fixed: 'left',
      visible: true,
      sorter: (a: any, b: any) => (a.assetCode > b.assetCode ? 1 : -1),
      render: (text: string, record) => {
        return (
          <Tooltip title={text}>
            {/* <div className={pageStyles['over-flow-hidden']}>{text || '--'}</div> */}
            <a className={pageStyles['over-flow-hidden']} onClick={() => openDraw(record)}>
              {text || '--'}
            </a>
          </Tooltip>
        );
      },
    },
    {
      title: '资产名称',
      dataIndex: 'assetName',
      key: 'assetName',
      width: 160,
      fixed: 'left',
      ellipsis: {
        showTitle: true,
      },
      visible: true,
      unDrag: true,
      sorter: (a: any, b: any) => (a.assetName > b.assetName ? 1 : -1),
      render: (text: string) => {
        return (
          <Tooltip title={text}>
            <div className={pageStyles['over-flow-hidden']}>{text || '--'}</div>
          </Tooltip>
        );
      },
    },

    {
      title: '资产原值（元）',
      dataIndex: 'totalValueNew',
      key: 'totalValueNew',
      width: 170,
      visible: true,
      sorter: (a: any, b: any) => (a.totalValueNew > b.totalValueNew ? 1 : -1),
      render: (text: number | null) => formatDecimalFour(text),
    },
    {
      title: '财政拨款',
      dataIndex: 'fiscalAppropriationNew',
      key: 'fiscalAppropriationNew',
      width: 160,
      visible: true,
      sorter: (a: any, b: any) => (a.fiscalAppropriationNew > b.fiscalAppropriationNew ? 1 : -1),
      render: (text: number | null) => formatDecimalFour(text),
    },
    {
      title: '非财政拨款',
      dataIndex: 'noFiscalAppropriationNew',
      key: 'noFiscalAppropriationNew',
      width: 160,
      visible: true,
      sorter: (a: any, b: any) => (a.noFiscalAppropriationNew > b.noFiscalAppropriationNew ? 1 : -1),
      render: (text: number | null) => formatDecimalFour(text),
    },
    {
      title: '财务入账状态',
      dataIndex: 'entryStateNewName',
      key: 'entryStateNewName',
      width: 150,
      visible: true,
      sorter: (a: any, b: any) => (a.entryStateNewName > b.entryStateNewName ? 1 : -1),
      render: (text: number | null) => DictionaryRenderFun({ text, isState: false }),
    },

    {
      title: '记账日期',
      dataIndex: 'entryDateNew',
      key: 'entryDateNew',
      width: 200,
      visible: true,
      sorter: (a: any, b: any) => (a.entryDateNew > b.entryDateNew ? 1 : -1),
      render: (text: string) => removeDateHmsStr(text) || '--',
    },
    {
      title: '记账凭证号',
      dataIndex: 'entryCodeNew',
      key: 'entryCodeNew',
      width: 200,
      visible: true,
      sorter: (a: any, b: any) => (a.entryCodeNew > b.entryCodeNew ? 1 : -1),
      render: (text: number | null) => DictionaryRenderFun({ text, isState: false }),
    },
  ];
  if (pageType != 'detail') {
    tableConfig?.push({
      title: (
        <div style={{ width: '100%', textAlign: 'center' }}>
          <Button type="link" size="small" className="manageBtntTxtStyle" onMouseOut={onMouseOutBtn} onClick={openAssetModalStatus} icon={<DownloadOutlined />}>
            导出
          </Button>
          <Button type="link" size="small" className="manageBtntTxtStyle" onMouseOut={onMouseOutBtn} onClick={openUploadModalStatus} icon={<UploadOutlined />}>
            导入
          </Button>
        </div>
      ),
      dataIndex: 'otherBtn',
      key: 'otherBtn',
      visible: true,
      width: 150,
      fixed: 'right',
      render: (_text: any, record: any) => {
        return (
          <div className="counterpoartDelBtnStyle">
            <Button
              type="link"
              size="small"
              icon={<DeleteOutlined />}
              className={'manageBtntTxtStyle'}
              onMouseOut={onMouseOutBtn}
              onClick={() => delSelectRow(record)}
            >
              删除
            </Button>
          </div>
        );
      },
    });
  }
  return tableConfig;
};

/** 资产表格  (变动类型：种类) [作废]*/
const openKindAssetColumns = (delSelectRow, openAssetModalStatus, openUploadModalStatus, openDraw, pageType?: string) => {
  let tableConfig: Record<string, any>[] = [
    {
      title: '资产编号',
      dataIndex: 'assetCode',
      key: 'assetCode',
      width: 160,
      fixed: 'left',
      visible: true,
      sorter: (a: any, b: any) => (a.assetCode > b.assetCode ? 1 : -1),
      render: (text: string, record) => {
        return (
          <Tooltip title={text}>
            {/* <div className={pageStyles['over-flow-hidden']}>{text || '--'}</div>
             */}
            <a className={pageStyles['over-flow-hidden']} onClick={() => openDraw(record)}>
              {text || '--'}
            </a>
          </Tooltip>
        );
      },
    },
    {
      title: '资产名称',
      dataIndex: 'assetName',
      key: 'assetName',
      width: 160,
      fixed: 'left',
      ellipsis: {
        showTitle: true,
      },
      visible: true,
      unDrag: true,
      sorter: (a: any, b: any) => (a.assetName > b.assetName ? 1 : -1),
      render: (text: string) => {
        return (
          <Tooltip title={text}>
            <div className={pageStyles['over-flow-hidden']}>{text || '--'}</div>
          </Tooltip>
        );
      },
    },
    {
      title: '资产分类',
      dataIndex: 'assetClassNewName',
      key: 'assetClassNewName',
      width: 120,
      ellipsis: {
        showTitle: true,
      },
      visible: true,
      unDrag: true,
      sorter: (a: any, b: any) => (a.assetClassNewName > b.assetClassNewName ? 1 : -1),
      render: (text: number | null) => DictionaryRenderFun({ text, isState: false }),
    },

    {
      title: '折旧年限（月）',
      dataIndex: 'durableYearsNew',
      key: 'durableYearsNew',
      width: 160,
      visible: true,
      sorter: (a: any, b: any) => (a.durableYearsNew > b.durableYearsNew ? 1 : -1),
      render: (text: number | null) => formatDecimalFour(text),
    },
    {
      title: '单位会计科目',
      dataIndex: 'ledgerAccountNewName',
      key: 'ledgerAccountNewName',
      width: 160,
      visible: true,
      sorter: (a: any, b: any) => (a.ledgerAccountNewName > b.ledgerAccountNewName ? 1 : -1),
      render: (text: number | null) => formatDecimalFour(text),
    },
  ];
  if (pageType != 'detail') {
    tableConfig?.push({
      title: (
        <div style={{ width: '100%', textAlign: 'center' }}>
          <Button type="link" size="small" className="manageBtntTxtStyle" onMouseOut={onMouseOutBtn} onClick={openAssetModalStatus} icon={<DownloadOutlined />}>
            导出
          </Button>
          <Button type="link" size="small" className="manageBtntTxtStyle" onMouseOut={onMouseOutBtn} onClick={openUploadModalStatus} icon={<UploadOutlined />}>
            导入
          </Button>
        </div>
      ),
      dataIndex: 'otherBtn',
      key: 'otherBtn',
      visible: true,
      width: 150,
      fixed: 'right',
      render: (_text: any, record: any) => {
        return (
          <div className="counterpoartDelBtnStyle">
            <Button
              type="link"
              size="small"
              icon={<DeleteOutlined />}
              className={'manageBtntTxtStyle'}
              onMouseOut={onMouseOutBtn}
              onClick={() => delSelectRow(record)}
            >
              删除
            </Button>
          </div>
        );
      },
    });
  }
  return tableConfig;
};

/** 表格配置 */
const assetTableConfig = () => {
  return [
    {
      title: '资产编号',
      dataIndex: 'assetCode',
      key: 'assetCode',
      width: 160,
      fixed: 'left',
      visible: true,
      sorter: (a: any, b: any) => (a.assetCode > b.assetCode ? 1 : -1),
      render: (text: string) => {
        return (
          <Tooltip title={text}>
            <div className={pageStyles['over-flow-hidden']}>{text || '--'}</div>
          </Tooltip>
        );
      },
    },
    {
      title: '资产名称',
      dataIndex: 'assetName',
      key: 'assetName',
      width: 160,
      fixed: 'left',
      ellipsis: {
        showTitle: true,
      },
      visible: true,
      unDrag: true,
      sorter: (a: any, b: any) => (a.assetName > b.assetName ? 1 : -1),
      render: (text: string) => {
        return (
          <Tooltip title={text}>
            <div className={pageStyles['over-flow-hidden']}>{text || '--'}</div>
          </Tooltip>
        );
      },
    },
    {
      title: '资产分类',
      dataIndex: 'assetClassName',
      key: 'assetClassName',
      width: 120,
      ellipsis: {
        showTitle: true,
      },
      visible: true,
      unDrag: true,
      sorter: (a: any, b: any) => (a.assetClassName > b.assetClassName ? 1 : -1),
      render: (text: string) => renderTableText(text, true),
    },
    {
      title: '品牌',
      dataIndex: 'brandType',
      key: 'brandType',
      width: 120,
      visible: true,
      sorter: (a: any, b: any) => (a.brandType > b.brandType ? 1 : -1),
      render: (text: string) => renderTableText(text, true),
    },
    {
      title: '资产原值',
      dataIndex: 'totalValue',
      key: 'totalValue',
      width: 120,
      visible: true,
      sorter: (a: any, b: any) => (a.totalValue > b.totalValue ? 1 : -1),
      render: (text: string) => renderTableText(text, true),
    },

    {
      title: '状态',
      dataIndex: 'assetStateName',
      key: 'assetStateName',
      width: 120,
      ellipsis: {
        showTitle: true,
      },
      visible: true,
      unDrag: true,
      sorter: (a: any, b: any) => (a.assetStateName > b.assetStateName ? 1 : -1),
      render: (text: string) => renderTableText(text, true),
    },
    {
      title: '取得日期',
      dataIndex: 'obtainDate',
      key: 'obtainDate',
      width: 150,
      visible: true,
      sorter: (a: any, b: any) => (a.obtainDate > b.obtainDate ? 1 : -1),
      render: (text: string) => removeDateHmsStr(text) || '--',
    },
    {
      title: '记账日期',
      dataIndex: 'entryDate',
      key: 'entryDate',
      width: 200,
      visible: true,
      sorter: (a: any, b: any) => (a.entryDate > b.entryDate ? 1 : -1),
      render: (text: string) => removeDateHmsStr(text) || '--',
    },
    {
      title: '使用部门',
      dataIndex: 'useDepartmentName',
      key: 'useDepartmentName',
      width: 150,
      visible: true,
      sorter: (a: any, b: any) => (a.useDepartmentName > b.useDepartmentName ? 1 : -1),
      render: (text: string) => {
        return (
          <Tooltip title={text}>
            <div className={pageStyles['over-flow-hidden']}>{text || '--'}</div>
          </Tooltip>
        );
      },
    },
    {
      title: '管理部门',
      dataIndex: 'assetDepartmentName',
      key: 'assetDepartmentName',
      width: 150,
      visible: true,
      sorter: (a: any, b: any) => (a.useDepartmentName > b.useDepartmentName ? 1 : -1),
      render: (text: string) => {
        return (
          <Tooltip title={text}>
            <div className={pageStyles['over-flow-hidden']}>{text || '--'}</div>
          </Tooltip>
        );
      },
    },
    {
      title: '使用人',
      dataIndex: 'userName',
      key: 'userName',
      width: 150,
      visible: true,
      sorter: (a: any, b: any) => (a.userName > b.userName ? 1 : -1),
      render: (text: string) => {
        return (
          <Tooltip title={text}>
            <div className={pageStyles['over-flow-hidden']}>{text || '--'}</div>
          </Tooltip>
        );
      },
    },
    {
      title: '管理人',
      dataIndex: 'asseterName',
      key: 'asseterName',
      width: 150,
      visible: true,
      sorter: (a: any, b: any) => (a.userName > b.userName ? 1 : -1),
      render: (text: string) => {
        return (
          <Tooltip title={text}>
            <div className={pageStyles['over-flow-hidden']}>{text || '--'}</div>
          </Tooltip>
        );
      },
    },
  ];
};

export { openAssetColumns, openImportantAssetColumns, openKindAssetColumns, assetTableConfig, openImportColumns };
